\begin{answer}{derivexpowx}
This is question 6.18 from \citet{JoshiQA}.
Questions appearing as though they are pure mathematics are usually asking you to do two different things:
\begin{enumerate}
  \item Simplify and rewrite the problem
  \item Solve the problem using integration or differentiation
\end{enumerate}
The former is harder, especially if you don't know the trick for that specific question.
If you show potential for solving the question, the interviewer will likely give you hints to get to the rewrite trick.
The latter part requires calculus from a year-one mathematics course.
That is a lot of theory to brush up on, but the rules highlighted in appendix \ref{ap:cribsheet} should be sufficient for most interview questions.

The wrong answer is $(x-1) x^{x-1}$.
Here is the rewrite trick that will put you on the right track,
\begin{align*}
  x^x &= e^{ \ln(x^x )} \\
      &= e^{x \ln(x )}
      \text{.}
\end{align*}
Follow this by using the chain rule and the product rule. Let
\begin{align*}
      e^{x \ln(x )} &=  e^{u} \\
      u &= x \ln(x) \\
     du &= 1 + \ln(x) \quad (\text{Product rule})
\end{align*}
then
\begin{align*}
\frac{d}{dx} e^{x \ln(x )} &= \frac{d}{du} e^{u}  \frac{du}{dx} \\
                           &=  e^{u} (1 + \ln(x)) \\
                           &=  e^{x \ln(x)} (1 + \ln(x)) \\
                           &=  x^x (1 + \ln(x))
\text{.}
\end{align*}
\end{answer}
